import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingDeque;
import java.util.concurrent.BlockingQueue;

public class Demo1 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> queue=new ArrayBlockingQueue<>(3 );   //Blocking阻塞的
        queue.put("111");
        System.out.println("put 成功");
        queue.put("111");
        System.out.println("put 成功");
//        queue.put("111");
//        System.out.println("put 成功");
//        queue.put("111");
//        System.out.println("put 成功");


        queue.take();
        System.out.println("take");
        queue.take();
        System.out.println("take");
        queue.take();
        System.out.println("take");
    }
}
